package Chapter7;

//150页程序7.7的前置类
class BankAccount {
    private String ownerName;
    private int accountNumber;
    private float balance;

    String getOwnerName() {
        return ownerName;
    }

    void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    int getAccountNumber() {
        return accountNumber;
    }

    void setAccountNumber(int accountNumber) {
        this.accountNumber = accountNumber;
    }

    float getBalance() {
        return balance;
    }

    void setBalance(float balance) {
        this.balance = balance;
    }

    void deposit(float Deposit) {
        this.balance += Deposit;
    }

    BankAccount() {
        this.ownerName = "nobody";
        this.accountNumber = 0;
        this.balance = 0;
    }

    BankAccount(String ownerName, int accountNumber) {
        this.ownerName = ownerName;
        this.accountNumber = accountNumber;
    }

    BankAccount(String ownerName, int accountNumber, float balance) {
        this.ownerName = ownerName;
        this.accountNumber = accountNumber;
        this.balance = balance;
    }
}
